#include "Memento.h"

//main函数充当了caretaker的角色
int main()
{
	Originator ori(2);	
	ori.PrintState();
	Memento* p = ori.CreateMemento();

	cout << "change state\n";
	ori.SetState(3);
	ori.PrintState();

	cout << "restore state\n";
	ori.SetMemento(p);
	ori.PrintState();

	delete p;

	return 0;
}
